package com.xbts.screen.monitor.domain.request;

import java.util.ArrayList;
import java.util.List;

public enum PlayBackFormatEnum {

    HLS("hls","hls"),
    FLV("flv","flv"),
    RTMP("rtmp","rtmp"),
    RTSP("rtsp","rtsp"),
    ;
    public String code;
    public String msg;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    PlayBackFormatEnum(String code, String msg){
        this.code = code;
        this.msg = msg;
    }

    public static List<String> getOpenTypeList(){
        List<String> list = new ArrayList<String>();
        for(PlayBackFormatEnum item : PlayBackFormatEnum.values()){
            list.add(item.code);
        }
        return list;
    }

    public static boolean isRight(String type){
        if(type == null){
            return false;
        }
        for(PlayBackFormatEnum item : PlayBackFormatEnum.values()){
            if(type.equals(item.code)){
                return true;
            }
        }
        return false;
    }
}
